home *** CD-ROM | disk | FTP | other *** search
- .Na "dbtabsource"
- .mc |
- .Aa
- .Fu
- Return the name and number of the table from which a particular result column
- was derived.
- .Ih "result column, returning database table corresponding to a"
- .Sy
- .Sf "char *dbtabsource(dbproc, colnum, tabnum)"
- .Sp "DBPROCESS" "*dbproc"
- .Sp "int" "colnum"
- .Sp "int" "*tabnum"
- .Co
- .Bl
- \f2dbtabsource()\f1 is one of the \*L browse mode routines.
- It is usable only with results from a browse-mode SELECT (\f2i.e.,\f1
- a SELECT containing the key words FOR BROWSE).
- See the Introduction for a detailed discussion of browse mode.
- .Bl
- \f2dbtabsource()\f1 allows an application to determine which tables provided
- the columns in the current set of result rows. This information
- is valuable when using \f2dbqual()\f1
- to construct WHERE clauses for UPDATE and DELETE statements based on ad hoc queries.
- If the query has been hardcoded into the program, this routine is obviously unnecessary.
- .Bl
- The application can call
- \f2dbtabsource()\f1 any time after \f2dbresults()\f1.
- .Bl
- Example 7 in the \f2\*L Reference Supplement\f1 contains a call to \f2dbtabsource()\f1.
- .Bz
- .Pa
- .Pi dbproc
- A pointer to the DBPROCESS structure that provides the connection
- for a particular front-end/\*S process. It contains all the
- information that \*L uses to manage communications and data between the
- front end and \*S.
- .Pi colnum
- The number of the result column of interest. Column numbers
- start at 1.
- .Pi tabnum
- A pointer to an integer, which will be filled in with the
- table's number. Many \*L routines that deal with
- browse mode accept either a table name or a table number.
- If \f2dbtabsource()\f1 returns NULL (see below), \f2*tabnum\f1
- will be set to -1.
- .in -.375i
- .Re
- .br
- A pointer to the name of the table from which this result column was
- derived. A NULL return value can mean a few different things:
- .Bl
- The DBPROCESS is dead or not enabled. This is an
- error that will cause an application's error handler to be invoked.
- .Bl
- The column number is out of range.
- .Bl
- The column is the result of an expression, such as ``max(colname)''.
- .Bz
- .Sa
- dbcolbrowse,
- dbcolsource,
- dbqual,
- dbtabbrowse,
- dbtabcount,
- dbtabname,
- dbtsnewlen,
- dbtsnewval,
- .mc
-